<?php
/**
 * @package		Joomla
 * @subpackage	Templates
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// No direct access.
defined('_JEXEC') or die();

// get params
$application	= JFactory::getApplication();
$document			= JFactory::getDocument();
$params				= $application->getTemplate(true)->params;

// bereinige die HEAD Bloecke, die nicht benoetigt werden
// doctype wird selbst gesetzt
$document->_metaTags['http-equiv'] = array();

// entferne MooTools; @todo core.js mit JQuery nachbauen; @todo als Plugin auslagern
$document->_scripts	= array();
$document->_script	= array();

// entferne base Tag und Generator
$document->base				= null;
$document->_generator = null;

// Helper registrieren
JLoader::register('TplPlainTemplateHelper', JPATH_SITE . DS . 'templates' . DS . $this->template . DS . 'helpers' . DS . 'template.php');
JLoader::register('TplPlainModuleHelper', JPATH_SITE . DS . 'templates' . DS . $this->template . DS . 'helpers' . DS . 'module.php');
?>
<?php echo '<!doctype html>' . "\n"; ?>
<html lang="<?php echo $this->language; ?>">
<head>
	<meta charset="<?php echo $document->getCharset(); ?>" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

	<jdoc:include type="head" />
	<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/css/screen.css" type="text/css" />
	<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/css/jcarousel.css" type="text/css" />
	<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/css/fancybox.css" type="text/css" />

	<!--[if lt ie 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body class="no-js <?php echo TplPlainTemplateHelper::browserCssClass(); ?> <?php echo TplPlainTemplateHelper::pageTitleCssClass(); ?>">

	<div id="page">
		<header>
			<?php if($this->countModules('header') !== 0) { ?>
				<jdoc:include type="modules" name="header" style="container" />
			<?php } ?>
		</header>

		<div class="clearfix">

			<!-- sidebar -->
			<div id="sidebar">
				<?php if($this->countModules('mainmenu') !== 0) { ?>
					<jdoc:include type="modules" name="mainmenu" style="navigation" id="mainmenu" />
				<?php } ?>
				<?php if($this->countModules('sidebar') !== 0) { ?>
					<jdoc:include type="modules" name="sidebar" style="container" class="content" />
				<?php } ?>
			</div>
			<!-- /sidebar -->

			<!-- body -->
			<div id="body" class="content">
				<jdoc:include type="message" />

				<?php if($this->countModules('before-body') !== 0) { ?>
					<jdoc:include type="modules" name="before-body" style="container" />
				<?php } ?>

				<jdoc:include type="component" />

				<?php if($this->countModules('after-body') !== 0) { ?>
					<jdoc:include type="modules" name="after-body" style="container" />
				<?php } ?>
			</div>
			<!-- /body -->

		</div>

		<footer>
			<div id="copyright">
				&copy; <?php echo date('Y'); ?> <?php echo htmlspecialchars($application->getCfg('sitename')); ?>
			</div>

			<div class="clearfix">
				<?php if($this->countModules('footer-left') !== 0) { ?>
					<jdoc:include type="modules" name="footer-left" style="container" />
				<?php } ?>
				<?php if($this->countModules('footer-right') !== 0) { ?>
					<jdoc:include type="modules" name="footer-right" style="container" />
				<?php } ?>
			</div>
		</footer>
	</div>

	<jdoc:include type="modules" name="debug" />

	<!-- scripts -->
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
	<script type="text/javascript">!window.jQuery && document.write(unescape('%3Cscript type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/javascript/jquery-1.7.1.js"%3E%3C/script%3E'))</script>
	<!--<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/javascript/?v=1.0.0"></script>-->
	<script type="text/javascript" src="/index.php?tmpl=javascript"></script>
	<!-- /scripts -->
</body>
</html>
